package com.power.sifa.approve.api;

import com.plf.common.domain.ResponseDTO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.power.sifa.approve.model.Apl_dossier;
import com.power.sifa.approve.model.pageInfo.Apl_dossierPageInfo;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 *  电子卷宗 Feign
 */
public interface IApl_dossierFeign {

    /**
     * 电子卷宗分页列表
     */
    @PostMapping("/apl_dossier/list")
    ResponseDTO list(@RequestBody Apl_dossierPageInfo apl_dossierPageInfo);

    /**
    * 查看电子卷宗
    */
    @GetMapping("/apl_dossier/view")
    ResponseDTO view(@RequestParam("id") String id);

    /**
    * 删除电子卷宗
    */
    @PostMapping("/apl_dossier/delete")
    ResponseDTO delete(@RequestParam("id") String id);

    ///**
    // * 查看电子卷宗 复合主键使用
    // */
    //@PostMapping("/apl_dossier/viewByPK")
    //ResponseDTO viewByPK(@RequestBody Apl_dossier.Apl_dossierPK pk);

    /**
     * 修改或保存电子卷宗
     */
    @PostMapping("/apl_dossier/save")
    ResponseDTO save(@RequestBody Apl_dossier  apl_dossier);

    ///**
    // * 删除电子卷宗 复合主键使用
    // */
    //@PostMapping("/apl_dossier/deleteByPK")
    //ResponseDTO deleteByPK(@RequestBody Apl_dossier.Apl_dossierPK pk);

    /**
     * 批量删除电子卷宗
     */
    @PostMapping("/apl_dossier/batchDel")
    ResponseDTO batchDel(@RequestParam("ids") String ids);

     /**
     * 导出excel
     */
    @PostMapping("/apl_dossier/output")
    void output(HttpServletResponse response, @RequestBody Apl_dossierPageInfo apl_dossierPageInfo);

     /**
     * 导出excel模板
     */
    @PostMapping("/apl_dossier/exportExcelTemplate")
    void exportExcelTemplate(HttpServletResponse response);

     /**
     *	导入excel
     */
    @PostMapping("/apl_dossier/importExcel")
    ResponseDTO importExcel(@RequestBody MultipartFile file) throws IOException ;


    /**
     * 通过applyid查询对应的电子卷宗文件树形结构
     * @param applyid
     * @param isEdit 是否是编辑模式
     * @return
     */
    @PostMapping("/apl_dossier/getDocTreeByApplyid")
    ResponseDTO getDocTreeByApplyid(@RequestParam("applyid") String applyid, @RequestParam("isEdit") Boolean isEdit, @RequestParam("serviceType") Integer serviceType);

    /**
     * 删除树层级节点数据，删除全部的子层级文件
     * @param treeNodeId
     * @return
     */
    @PostMapping("/apl_dossier/deleteTreeNode")
    ResponseDTO deleteTreeNode(@RequestParam("treeNodeId") String treeNodeId);


    /**
     * 新增层级节点数据，
     * @param treeNodeType 节点类型
     * @param treeNodeName 节点名称
     * @param parentId 父节点id
     * @return
     */
    @PostMapping("/apl_dossier/addTreeNode")
    ResponseDTO addTreeNode(@RequestParam("treeNodeType") Integer treeNodeType,
                            @RequestParam("treeNodeName") String treeNodeName,
                            @RequestParam("parentId") String parentId);

    /**
     * 新增根节点数据，
     * @param applyid
     * @param treeNodeName
     * @return
     */
    @PostMapping("/apl_dossier/addRootTreeNode")
    ResponseDTO addRootTreeNode (@RequestParam("applyid") String applyid, @RequestParam("treeNodeName") String treeNodeName,
                                 @RequestParam("parentId") String parentId);


    /**
     * 保存材料文件到对应的树节点- 文件已入库保存
     * @param applyid
     * @param parentId
     * @param materialId
     * @param materialName
     * @return
     */
    @PostMapping("/apl_dossier/saveMaterialToTree")
    ResponseDTO saveMaterialToTree (@RequestParam("applyid") String applyid,
                                    @RequestParam("parentId") String parentId,
                                    @RequestParam("materialId") String materialId,
                                    @RequestParam("materialName") String materialName,
                                    @RequestParam("deleted") Integer deleted,
                                    @RequestParam("mattype") String mattype);


    /**
     *  保存材料文件到对应的树节点- 文件未入库保存
     * @param files
     * @param applyid
     * @param parentId
     * @return
     */
    @PostMapping("/apl_dossier/saveNoStoreMaterialToTree")
    ResponseDTO saveNoStoreMaterialToTree (@RequestPart("files") List<MultipartFile> files,
                                    @RequestParam("applyid") String applyid,
                                    @RequestParam("parentId") String parentId);


    /**
     * 更新节点名称
     * @param treeNodeId
     * @param treeNodeName
     * @return
     */
    @PostMapping("/apl_dossier/updateTreeNodeName")
    ResponseDTO updateTreeNodeName(@RequestParam("treeNodeId") String treeNodeId, @RequestParam("treeNodeName") String treeNodeName);


    /**
     * 重新更新目录页码序号
     * @param applyid
     * @return
     */
    @PostMapping("/apl_dossier/updateTreeNodeIndex")
    ResponseDTO updateTreeNodeIndex(@RequestParam("applyid") String applyid);



    /**
     * 案件归档接口
     * @param applyid
     * @param userId
     * @param userName
     * @return
     */
    @PostMapping("/apl_dossier/recordCase")
    ResponseDTO recordCase(@RequestParam("applyid") String applyid, @RequestParam("userId") String userId,
                           @RequestParam("userName") String userName,@RequestParam("serviceType") Integer serviceType);


    /**
     * 重新生成文件目录
     * @param applyid
     * @return
     */
    @PostMapping("/apl_dossier/regenerateDocTree")
    ResponseDTO regenerateDocTree (@RequestParam("applyid") String applyid);

    /**
     * 重新生成文件目录
     * @param applyid
     * @return
     */
    @PostMapping("/apl_dossier/regenerateSuperviseDocTree")
    ResponseDTO regenerateSuperviseDocTree (@RequestParam("applyid") String applyid);
}
